package cn.wcy.po;

import cn.wcy.entity.Person;
import cn.wcy.servcie.impl.UserServiceImpl;
import cn.wcy.server.UserService;
import cn.wcy.server.impl.AUserServiceImpl;

import java.lang.reflect.Field;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ModulCTest {


    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        Person person = new Person("wcy",30);
        System.out.println(person.toString());

        Logger logger = Logger.getLogger(ModulCTest.class.getName());
        logger.log(Level.INFO, "HELLO,WORLD");

        // 反射
        Person person1 = new Person("wcy",30);
        Class<Person> userPerson = Person.class;
        Field field = userPerson.getDeclaredField("name");
        field.setAccessible(true);   //尝试修改访问权限
        System.out.println(field.get(person1));

        UserService userService = new UserServiceImpl();
        System.out.println(userService.get("奥特曼").toString());

        UserService userService1 = new AUserServiceImpl();
    }
}
